import React, {Component} from 'react';
import './index.less';
import {
    base
} from 'nc-lightapp-front';

export default class PageHeader extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        const {
            status, 
            onClick,
            button
        } = this.props;
        
        return (
            <div>
                <Choose>
                    <When condition={status==='browse'}>
                        {button.createButtonApp({
                            area: 'appconfgrid',
                            onButtonClick: onClick('edit_status')
                        })}
                    </When>
                    <When condition={status==='edit'}>
                        {button.createButtonApp({
                            area: 'appconfgrid',
                            onButtonClick: onClick('browse_status')
                        })}
                    </When>
                </Choose>
            </div>
        );
    }
}